<%= render :partial => 'edit_channel_header' -%>

<%- form_for_channel do |f| -%>
  <%= f.error_messages -%>
  <%= f.hidden_field :direction, :value => Channel::Bidirectional -%>
  <%= render :partial => 'edit_name', :locals => {:f => f} -%>
  <%= render :partial => 'edit_protocol', :locals => {:f => f, :default => 'sms'} -%>
  <%= render :partial => 'edit_priority', :locals => {:f => f} -%>
  <%= render :partial => 'edit_application', :locals => {:f => f} -%>
  <%= render :partial => 'edit_direction' -%>
  <%= render :partial => 'edit_address', :locals => {:f => f} -%>
  <%- f.fields_for :configuration do |c| -%>
    <h5>MT POST</h5>
    <p>
    <%= c.label :mt_post_url, 'URL' -%><br/>
    <%= c.text_field :mt_post_url, :value => @channel[:configuration][:mt_post_url] -%>
    </p>
    <p>
    <%= c.label :mt_post_user, 'User (optional)' -%><br/>
    <%= c.text_field :mt_post_user, :value => @channel[:configuration][:mt_post_user] -%>
    </p>
    <p>
    <%= c.label :mt_post_password, 'Password (optional)' -%><br/>
    <%= c.password_field :mt_post_password, :autocomplete => :off, :value => @channel[:configuration][:mt_post_password] -%>
    </p>
    <p>
    <%= c.label :cid, 'Connection ID (cid)' -%><br/>
    <%= c.text_field :cid, :value => @channel[:configuration][:cid] -%>
    </p>
    <p>
    <%= c.label :bid, 'Billing Level (bid)' -%><br/>
    <%= c.text_field :bid, :value => @channel[:configuration][:bid] -%>
    </p>
  <%- end -%>
  <%= render :partial => 'shared/edit_custom_attributes', :locals => {:f => f, :entity => @channel, :as_restriction => true} -%>
  <%= render :partial => 'edit_ao_rules', :locals => {:f => f} -%>
  <%= render :partial => 'edit_at_rules', :locals => {:f => f} -%>
  <%= channel_submit_tag -%>
<%- end -%>

<%= link_to 'Go back', :controller => :home, :action => :channels -%>
